var MimesToExt	=
{
	'application/andrew-inset'	:'ez',
	'application/chemtool'	:'cht',
	'application/dicom'	:'dcm',
	'application/docbook+xml'	:'docbook',
	'application/illustrator'	:'ai',
	'application/mathematica'	:'nb',
	'application/msword'	:'doc',
	'application/octet-stream'	:'bin',
	'application/oda'	:'oda',
	'application/ogg'	:'ogg',
	'application/pdf'	:'pdf',
	'application/pgp'	:'pgp',
	'application/pgp-encrypted'	:'pgp',
	'application/pgp-keys'	:'skr',
	'application/pgp-signature'	:'sig',
	'application/pkcs7-signature'	:'p7s',
	'application/postscript'	:'ps',
	'application/rtf'	:'rtf',
	'application/sdp'	:'sdp',
	'application/smil'	:'sml',
	'application/stuffit'	:'sit',
	'application/vnd.corel-draw'	:'cdr',
	'application/vnd.hp-hpgl'	:'hpgl',
	'application/vnd.hp-pcl'	:'pcl',
	'application/vnd.lotus-1-2-3'	:'wks',
	'application/vnd.mozilla.xul+xml'	:'xul',
	'application/vnd.ms-excel'	:'xlw',
	'application/vnd.ms-powerpoint'	:'ppz',
	'application/vnd.oasis.opendocument.chart'	:'odc',
	'application/vnd.oasis.opendocument.database'	:'odb',
	'application/vnd.oasis.opendocument.formula'	:'odf',
	'application/vnd.oasis.opendocument.graphics'	:'odg',
	'application/vnd.oasis.opendocument.graphics-template'	:'otg',
	'application/vnd.oasis.opendocument.image'	:'odi',
	'application/vnd.oasis.opendocument.presentation'	:'odp',
	'application/vnd.oasis.opendocument.presentation-template'	:'otp',
	'application/vnd.oasis.opendocument.spreadsheet'	:'ods',
	'application/vnd.oasis.opendocument.spreadsheet-template'	:'ots',
	'application/vnd.oasis.opendocument.text'	:'odt',
	'application/vnd.oasis.opendocument.text-master'	:'odm',
	'application/vnd.oasis.opendocument.text-template'	:'ott',
	'application/vnd.oasis.opendocument.text-web'	:'oth',
	'application/vnd.palm'	:'pdb',
	'application/vnd.rn-realmedia'	:'rm',
	'application/vnd.rn-realmedia-secure'	:'rms',
	'application/vnd.rn-realmedia-vbr'	:'rmvb',
	'application/vnd.stardivision.calc'	:'sdc',
	'application/vnd.stardivision.chart'	:'sds',
	'application/vnd.stardivision.draw'	:'sda',
	'application/vnd.stardivision.impress'	:'sdp',
	'application/vnd.stardivision.mail'	:'smd',
	'application/vnd.stardivision.math'	:'smf',
	'application/vnd.stardivision.writer'	:'vor',
	'application/vnd.sun.xml.calc'	:'sxc',
	'application/vnd.sun.xml.calc.template'	:'stc',
	'application/vnd.sun.xml.draw'	:'sxd',
	'application/vnd.sun.xml.draw.template'	:'std',
	'application/vnd.sun.xml.impress'	:'sxi',
	'application/vnd.sun.xml.impress.template'	:'sti',
	'application/vnd.sun.xml.math'	:'sxm',
	'application/vnd.sun.xml.writer'	:'sxw',
	'application/vnd.sun.xml.writer.global'	:'sxg',
	'application/vnd.sun.xml.writer.template'	:'stw',
	'application/vnd.wordperfect'	:'wpd',
	'application/x-abiword'	:'zabw',
	'application/x-amipro'	:'sam',
	'application/x-anjuta-project'	:'prj',
	'application/x-applix-spreadsheet'	:'as',
	'application/x-applix-word'	:'aw',
	'application/x-archive'	:'a',
	'application/x-arj'	:'arj',
	'application/x-asax'	:'asax',
	'application/x-ascx'	:'ascx',
	'application/x-ashx'	:'ashx',
	'application/x-asix'	:'asix',
	'application/x-asmx'	:'asmx',
	'application/x-asp'	:'asp',
	'application/x-aspx'	:'aspx',
	'application/x-axd'	:'axd',
	'application/x-bcpio'	:'bcpio',
	'application/x-bittorrent'	:'torrent',
	'application/x-blender'	:'blender',
	'application/x-bzip'	:'bz2',
	'application/x-bzip-compressed-tar'	:'tbz2',
	'application/x-cd-image'	:'iso',
	'application/x-cgi'	:'cgi',
	'application/x-chess-pgn'	:'pgn',
	'application/x-chm'	:'chm',
	'application/x-cmbx'	:'cmbx',
	'application/x-compress'	:'Z',
	'application/x-compressed-tar'	:'tgz',
	'application/x-config'	:'config',
	'application/x-cpio'	:'cpio',
	'application/x-cpio-compressed'	:'cpio.gz',
	'application/x-csh'	:'csh',
	'application/x-cue'	:'cue',
	'application/x-dbase'	:'dbf',
	'application/x-dc-rom'	:'dc',
	'application/x-deb'	:'deb',
	'application/x-designer'	:'ui',
	'application/x-desktop'	:'kdelnk',
	'application/x-devhelp'	:'devhelp',
	'application/x-dia-diagram'	:'dia',
	'application/x-disco'	:'disco',
	'application/x-dvi'	:'dvi',
	'application/x-e-theme'	:'etheme',
	'application/x-egon'	:'egon',
	'application/x-executable'	:'exe',
	'application/x-font-afm'	:'afm',
	'application/x-font-bdf'	:'bdf',
	'application/x-font-linux-psf'	:'psf',
	'application/x-font-pcf'	:'pcf.gz',
	'application/x-font-speedo'	:'spd',
	'application/x-font-ttf'	:'ttf',
	'application/x-font-type1'	:'pfb',
	'application/x-frontline'	:'aop',
	'application/x-gameboy-rom'	:'gb',
	'application/x-gdesklets-display'	:'display',
	'application/x-genesis-rom'	:'md',
	'application/x-gettext-translation'	:'gmo',
	'application/x-glabels'	:'glabels',
	'application/x-glade'	:'glade',
	'application/x-gnome-db-connection'	:'connection',
	'application/x-gnome-db-database'	:'database',
	'application/x-gnome-stones'	:'caves',
	'application/x-gnucash'	:'xac',
	'application/x-gnumeric'	:'gnumeric',
	'application/x-graphite'	:'gra',
	'application/x-gtar'	:'gtar',
	'application/x-gzip'	:'gz',
	'application/x-gzpostscript'	:'ps.gz',
	'application/x-hdf'	:'hdf',
	'application/x-ica'	:'ica',
	'application/x-jamin'	:'jam',
	'application/x-jar'	:'jar',
	'application/x-java'	:'class',
	'application/x-java-archive'	:'war',
	'application/x-java-jnlp-file'	:'jnlp',
	'application/x-javascript'	:'js',
	'application/x-jbuilder-project'	:'jpx',
	'application/x-karbon'	:'karbon',
	'application/x-kchart'	:'chrt',
	'application/x-kformula'	:'kfo',
	'application/x-killustrator'	:'kil',
	'application/x-kivio'	:'flw',
	'application/x-kontour'	:'kon',
	'application/x-kpovmodeler'	:'kpm',
	'application/x-kpresenter'	:'kpt',
	'application/x-krita'	:'kra',
	'application/x-kspread'	:'ksp',
	'application/x-kugar'	:'kud',
	'application/x-kword'	:'kwt',
	'application/x-lha'	:'lzh',
	'application/x-lhz'	:'lhz',
	'application/x-linguist'	:'ts',
	'application/x-lyx'	:'lyx',
	'application/x-lzop'	:'lzo',
	'application/x-lzop-compressed-tar'	:'tzo',
	'application/x-magicpoint'	:'mgp',
	'application/x-master-page'	:'master',
	'application/x-matroska'	:'mkv',
	'application/x-mdp'	:'mdp',
	'application/x-mds'	:'mds',
	'application/x-mdsx'	:'mdsx',
	'application/x-mergeant'	:'mergeant',
	'application/x-mif'	:'mif',
	'application/x-mps'	:'mps',
	'application/x-ms-dos-executable'	:'exe',
	'application/x-mswrite'	:'wri',
	'application/x-msx-rom'	:'msx',
	'application/x-n64-rom'	:'n64',
	'application/x-nes-rom'	:'nes',
	'application/x-netcdf'	:'nc',
	'application/x-object'	:'o',
	'application/x-oleo'	:'oleo',
	'application/x-palm-database'	:'prc',
	'application/x-par2'	:'par2',
	'application/x-perl'	:'pm',
	'application/x-php'	:'php4',
	'application/x-pkcs12'	:'pfx',
	'application/x-planner'	:'planner',
	'application/x-planperfect'	:'pln',
	'application/x-prjx'	:'prjx',
	'application/x-ptoptimizer-script'	:'pto',
	'application/x-pw'	:'pw',
	'application/x-python-bytecode'	:'pyo',
	'application/x-quattro-pro'	:'wb3',
	'application/x-quattropro'	:'wb3',
	'application/x-qw'	:'qif',
	'application/x-rar'	:'rar',
	'application/x-rar-compressed'	:'rar',
	'application/x-rdp'	:'rdp',
	'application/x-reject'	:'rej',
	'application/x-remoting'	:'rem',
	'application/x-resources'	:'resources',
	'application/x-resourcesx'	:'resx',
	'application/x-rpm'	:'rpm',
	'application/x-sc'	:'sc',
	'application/x-scribus'	:'sla.gz',
	'application/x-shar'	:'shar',
	'application/x-shared-library-la'	:'la',
	'application/x-sharedlib'	:'so',
	'application/x-shellscript'	:'sh',
	'application/x-shockwave-flash'	:'swf',
	'application/x-siag'	:'siag',
	'application/x-smil'	:'smil',
	'application/x-sms-rom'	:'sms',
	'application/x-soap-remoting'	:'soap',
	'application/x-streamingmedia'	:'ssm',
	'application/x-stuffit'	:'sit',
	'application/x-sv4cpio'	:'sv4cpio',
	'application/x-sv4crc'	:'sv4crc',
	'application/x-tar'	:'tar',
	'application/x-tarz'	:'tar.Z',
	'application/x-tex-gf'	:'gf',
	'application/x-tex-pk'	:'k',
	'application/x-tgif'	:'obj',
	'application/x-theme'	:'theme',
	'application/x-toc'	:'toc',
	'application/x-trash'	:'sik',
	'application/x-troff'	:'tr',
	'application/x-troff-man'	:'man',
	'application/x-tzo'	:'tzo',
	'application/x-ustar'	:'ustar',
	'application/x-wais-source'	:'src',
	'application/x-wpg'	:'wpg',
	'application/x-wsdl'	:'wsdl',
	'application/x-x509-ca-cert'	:'pem',
	'application/x-xbel'	:'xbel',
	'application/x-zoo'	:'zoo',
	'application/xhtml+xml'	:'xhtml',
	'application/zip'	:'zip',
	'audio/ac3'	:'ac3',
	'audio/basic'	:'snd',
	'audio/midi'	:'midi',
	'audio/mpeg'	:'mp3',
	'audio/prs.sid'	:'sid',
	'audio/vnd.rn-realaudio'	:'ra',
	'audio/x-aac'	:'aac',
	'audio/x-aiff'	:'aiff',
	'audio/x-flac'	:'flac',
	'audio/x-it'	:'it',
	'audio/x-m4a'	:'m4a',
	'audio/x-mod'	:'uni',
	'audio/x-mpegurl'	:'m3u',
	'audio/x-pn-realaudio'	:'rmm',
	'audio/x-s3m'	:'s3m',
	'audio/x-scpls'	:'xpl',
	'audio/x-stm'	:'stm',
	'audio/x-voc'	:'voc',
	'audio/x-wav'	:'wav',
	'audio/x-xi'	:'xi',
	'audio/x-xm'	:'xm',
	'image/bmp'	:'bmp',
	'image/cgm'	:'cgm',
	'image/fax-g3'	:'g3',
	'image/gif'	:'gif',
	'image/ief'	:'ief',
	'image/jpeg'	:'jpg',
	'image/jpeg2000'	:'jp2',
	'image/png'	:'png',
	'image/rle'	:'rle',
	'image/svg+xml'	:'svg',
	'image/tiff'	:'tiff',
	'image/vnd.djvu'	:'djvu',
	'image/vnd.dwg'	:'dwg',
	'image/vnd.dxf'	:'dxf',
	'image/x-3ds'	:'3ds',
	'image/x-applix-graphics'	:'ag',
	'image/x-cmu-raster'	:'ras',
	'image/x-compressed-xcf'	:'xcf.gz',
	'image/x-dcraw'	:'x3f',
	'image/x-eps'	:'epsi',
	'image/x-fits'	:'fits',
	'image/x-icb'	:'icb',
	'image/x-ico'	:'ico',
	'image/x-iff'	:'iff',
	'image/x-ilbm'	:'ilbm',
	'image/x-jng'	:'jng',
	'image/x-lwo'	:'lwob',
	'image/x-lws'	:'lws',
	'image/x-msod'	:'msod',
	'image/x-photo-cd'	:'pcd',
	'image/x-pict'	:'pict2',
	'image/x-portable-anymap'	:'pnm',
	'image/x-portable-bitmap'	:'pbm',
	'image/x-portable-graymap'	:'pgm',
	'image/x-portable-pixmap'	:'ppm',
	'image/x-psd'	:'psd',
	'image/x-rgb'	:'rgb',
	'image/x-sgi'	:'sgi',
	'image/x-sun-raster'	:'sun',
	'image/x-tga'	:'tga',
	'image/x-win-bitmap'	:'cur',
	'image/x-wmf'	:'wmf',
	'image/x-xbitmap'	:'xbm',
	'image/x-xcf'	:'xcf',
	'image/x-xfig'	:'fig',
	'image/x-xpixmap'	:'xpm',
	'image/x-xwindowdump'	:'xwd',
	'model/vrml'	:'wrl',
	'text/calendar'	:'vcs',
	'text/css'	:'css',
	'text/directory'	:'vct',
	'text/html'	:'html',
	'text/mathml'	:'mml',
	'text/plain'	:'txt',
	'text/rdf'	:'rdf',
	'text/richtext'	:'rtx',
	'text/rss'	:'rss',
	'text/sgml'	:'sgml',
	'text/spreadsheet'	:'sylk',
	'text/tab-separated-values'	:'tsv',
	'text/vnd.rn-realtext'	:'rt',
	'text/vnd.wap.wml'	:'wml',
	'text/x-adasrc'	:'ads',
	'text/x-bibtex'	:'bib',
	'text/x-boo'	:'boo',
	'text/x-c++hdr'	:'hh',
	'text/x-c++src'	:'cxx',
	'text/x-chdr'	:'hp',
	'text/x-comma-separated-values'	:'csv',
	'text/x-csharp'	:'cs',
	'text/x-csrc'	:'c',
	'text/x-dcl'	:'dcl',
	'text/x-dsl'	:'dsl',
	'text/x-dsrc'	:'d',
	'text/x-dtd'	:'dtd',
	'text/x-emacs-lisp'	:'el',
	'text/x-fortran'	:'f',
	'text/x-gettext-translation'	:'po',
	'text/x-gettext-translation-template'	:'pot',
	'text/x-haskell'	:'hs',
	'text/x-idl'	:'idl',
	'text/x-java'	:'java',
	'text/x-js'	:'js',
	'text/x-literate-haskell'	:'lhs',
	'text/x-log'	:'log',
	'text/x-moc'	:'moc',
	'text/x-msil'	:'il',
	'text/x-nemerle'	:'n',
	'text/x-objcsrc'	:'m',
	'text/x-pascal'	:'pas',
	'text/x-patch'	:'patch',
	'text/x-python'	:'py',
	'text/x-rng'	:'rng',
	'text/x-scheme'	:'scm',
	'text/x-setext'	:'etx',
	'text/x-sql'	:'sql',
	'text/x-tcl'	:'tk',
	'text/x-tex'	:'tex',
	'text/x-texinfo'	:'texinfo',
	'text/x-texmacs'	:'ts',
	'text/x-troff-me'	:'me',
	'text/x-troff-mm'	:'mm',
	'text/x-troff-ms'	:'ms',
	'text/x-uil'	:'uil',
	'text/x-uri'	:'url',
	'text/x-vb'	:'vb',
	'text/x-xds'	:'xds',
	'text/x-xmi'	:'xmi',
	'text/x-xsl'	:'xsl',
	'text/x-xslfo'	:'xslfo',
	'text/x-xslt'	:'xslt',
	'text/xml'	:'xml',
	'video/3gpp'	:'3gp',
	'video/dv'	:'dv',
	'video/mpeg'	:'vob',
	'video/quicktime'	:'qtvr',
	'video/vnd.rn-realvideo'	:'rv',
	'video/x-3gpp2'	:'3g2',
	'video/x-anim'	:'anim[1-9j]',
	'video/x-flic'	:'fli',
	'video/x-mng'	:'mng',
	'video/x-ms-asf'	:'asx',
	'video/x-ms-wmv'	:'wmv',
	'video/x-msvideo'	:'avi',
	'video/x-nsv'	:'nsv',
	'video/x-sgi-movie'	:'movie'
}
function checkIfFilenameHasExtension(filename)
{
	if(filename.lastIndexOf('.')!=-1)
		return true;
	return false;
}
function getExtensionFromMIMEType(mime)
{
	return '.'+MimesToExt[mime];
}
